package com.i.piccommon.config;
import com.alibaba.druid.spring.boot3.autoconfigure.DruidDataSourceBuilder;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
/**
 * @author lewis
 * @type class
 * @description
 * @since 2024/10/23
 */



import javax.sql.DataSource;

/**
 * @author lewis
 * @since 2024/7/24
 * @type class
 * @description
 */
@Configuration
public class DruidConfig {
    @Primary
    @Bean
    @ConfigurationProperties("spring.datasource.druid")
//    @RefreshScope
    public DataSource dataSource(){
        return DruidDataSourceBuilder.create().build();
    }
}

